<!doctype html>



  


<html class="theme-next mist use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="baidu-site-verification" content="zD47G9xe42" />


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="PHP核心编程," />





  <link rel="alternate" href="/atom.xml" title="uiste" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />






<meta name="description" content="ASCII编码ASCII码一共有128个，一个ASCII编码占用1个字节，也就是8位。所以我们书写字符串的时候，一个字母占用1个字节。ASCII编码全部都是连续的，比如A是65，B是66，C，67。ASCII编码小写字母比大写字母大32。比如A是65，小写a是97。
chr()   :    将一个数字转换成对应的ASCII码的字符。ord()     :    将一个ASCII码的字符转换成相对">
<meta property="og:type" content="article">
<meta property="og:title" content="Day3-php基础语法-数据类型、运算符、分支结构、包含文件">
<meta property="og:url" content="http://blog.uiste.com/20160823-1.html">
<meta property="og:site_name" content="uiste">
<meta property="og:description" content="ASCII编码ASCII码一共有128个，一个ASCII编码占用1个字节，也就是8位。所以我们书写字符串的时候，一个字母占用1个字节。ASCII编码全部都是连续的，比如A是65，B是66，C，67。ASCII编码小写字母比大写字母大32。比如A是65，小写a是97。
chr()   :    将一个数字转换成对应的ASCII码的字符。ord()     :    将一个ASCII码的字符转换成相对">
<meta property="og:updated_time" content="2016-08-24T00:10:04.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Day3-php基础语法-数据类型、运算符、分支结构、包含文件">
<meta name="twitter:description" content="ASCII编码ASCII码一共有128个，一个ASCII编码占用1个字节，也就是8位。所以我们书写字符串的时候，一个字母占用1个字节。ASCII编码全部都是连续的，比如A是65，B是66，C，67。ASCII编码小写字母比大写字母大32。比如A是65，小写a是97。
chr()   :    将一个数字转换成对应的ASCII码的字符。ord()     :    将一个ASCII码的字符转换成相对">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 0,
      author: '博主'
    }
  };
</script>




  <link rel="canonical" href="http://blog.uiste.com/20160823-1.html"/>

  <title>
 Day3-php基础语法-数据类型、运算符、分支结构、包含文件 | uiste 
</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?b58b87af012832b8ae35e33bb45b44fa";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">uiste</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">uiste个人博客</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      

            <li class="menu-item menu-item-search"> <a title="把这个链接拖到你的Chrome收藏夹工具栏中" href='javascript:(function() {
    function c() {
        var e = document.createElement("link");
        e.setAttribute("type", "text/css");
        e.setAttribute("rel", "stylesheet");
        e.setAttribute("href", f);
        e.setAttribute("class", l);
        document.body.appendChild(e)
    }
 
    function h() {
        var e = document.getElementsByClassName(l);
        for (var t = 0; t < e.length; t++) {
            document.body.removeChild(e[t])
        }
    }
 
    function p() {
        var e = document.createElement("div");
        e.setAttribute("class", a);
        document.body.appendChild(e);
        setTimeout(function() {
            document.body.removeChild(e)
        }, 100)
    }
 
    function d(e) {
        return {
            height : e.offsetHeight,
            width : e.offsetWidth
        }
    }
 
    function v(i) {
        var s = d(i);
        return s.height > e && s.height < n && s.width > t && s.width < r
    }
 
    function m(e) {
        var t = e;
        var n = 0;
        while (!!t) {
            n += t.offsetTop;
            t = t.offsetParent
        }
        return n
    }
 
    function g() {
        var e = document.documentElement;
        if (!!window.innerWidth) {
            return window.innerHeight
        } else if (e && !isNaN(e.clientHeight)) {
            return e.clientHeight
        }
        return 0
    }
 
    function y() {
        if (window.pageYOffset) {
            return window.pageYOffset
        }
        return Math.max(document.documentElement.scrollTop, document.body.scrollTop)
    }
 
    function E(e) {
        var t = m(e);
        return t >= w && t <= b + w
    }
 
    function S() {
        var e = document.createElement("audio");
        e.setAttribute("class", l);
        e.src = i;
        e.loop = false;
        e.addEventListener("canplay", function() {
            setTimeout(function() {
                x(k)
            }, 500);
            setTimeout(function() {
                N();
                p();
                for (var e = 0; e < O.length; e++) {
                    T(O[e])
                }
            }, 15500)
        }, true);
        e.addEventListener("ended", function() {
            N();
            h()
        }, true);
        e.innerHTML = " <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>";
        document.body.appendChild(e);
        e.play()
    }
 
    function x(e) {
        e.className += " " + s + " " + o
    }
 
    function T(e) {
        e.className += " " + s + " " + u[Math.floor(Math.random() * u.length)]
    }
 
    function N() {
        var e = document.getElementsByClassName(s);
        var t = new RegExp("\\b" + s + "\\b");
        for (var n = 0; n < e.length; ) {
            e[n].className = e[n].className.replace(t, "")
        }
    }
 
    var e = 30;
    var t = 30;
    var n = 350;
    var r = 350;
    var i = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";
    var s = "mw-harlem_shake_me";
    var o = "im_first";
    var u = ["im_drunk", "im_baked", "im_trippin", "im_blown"];
    var a = "mw-strobe_light";
    var f = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";
    var l = "mw_added_css";
    var b = g();
    var w = y();
    var C = document.getElementsByTagName("*");
    var k = null;
    for (var L = 0; L < C.length; L++) {
        var A = C[L];
        if (v(A)) {
            if (E(A)) {
                k = A;
                break
            }
        }
    }
    if (A === null) {
        console.warn("Could not find a node of the right size. Please try a different page.");
        return
    }
    c();
    S();
    var O = [];
    for (var L = 0; L < C.length; L++) {
        var A = C[L];
        if (v(A)) {
            O.push(A)
        }
    }
})()    '>High</a> </li>

    </ul>
  

 
    <div class="site-search">
      
  <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>


    </div>
   
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Day3-php基础语法-数据类型、运算符、分支结构、包含文件
              
            
          </h1>
        

        <div class="post-meta">
        
  <span id="busuanzi_container_page_pv">阅读量 <span id="busuanzi_value_page_pv"></span> 次</span>

          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2016-08-23T21:03:06+08:00" content="2016-08-23">
              2016-08-23
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/PHP/" itemprop="url" rel="index">
                    <span itemprop="name">PHP</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/20160823-1.html#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="20160823-1.html" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          
          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="ASCII编码"><a href="#ASCII编码" class="headerlink" title="ASCII编码"></a>ASCII编码</h3><p>ASCII码一共有128个，一个ASCII编码占用1个字节，也就是8位。所以我们书写字符串的时候，一个字母占用1个字节。<br>ASCII编码全部都是连续的，比如A是65，B是66，C，67。<br>ASCII编码小写字母比大写字母大32。比如A是65，小写a是97。</p>
<p>chr()   :    将一个数字转换成对应的ASCII码的字符。<br>ord()     :    将一个ASCII码的字符转换成相对应的数</p>
<p>\num   就是将八进制的num转换成ascii编码<br>\xnum  就是将十六进制的num转换成ascii编码</p>
<h3 id="布尔型"><a href="#布尔型" class="headerlink" title="布尔型"></a>布尔型</h3><p>数字：0、0.0、0.00 等0数都是false<br>字符串：”0”、” “空字符串都是false<br>null 和所有为空的数据类型都是false</p>
<h3 id="数组"><a href="#数组" class="headerlink" title="数组"></a>数组</h3><p>如果不给数组添加下标，则默认下标从0开始依次递增<br>如果数组元素下标之前已经存在数字下标了，那么新的元素下标则为之前元素下标的最大值<code>+1</code>;<br>如果数组元素存在同样的下标，那么后面下标对应的值会将前面的值给<strong>覆盖</strong>。<br>数组的<strong>下标</strong>只能是字符串或者整型，如果是其他数据类型，他会将其强制转换成字符串或者整型。</p>
<h3 id="对象"><a href="#对象" class="headerlink" title="对象"></a>对象</h3><p>对象和数组非常的相似，唯一的区别就是可以在对象里面书写函数，所以我们一般成对象为有生命的数组</p>
<h3 id="空型-null"><a href="#空型-null" class="headerlink" title="空型  null"></a>空型  null</h3><p>如果一个变量，我们不进行赋值，那么他就是一个null<br>同样的我们也可以主动的给一个变量赋值为null<br>一般情况下，如果一个变量占据了很大的空间，我们又暂时用不到他，我们就可以将他赋值为null，这样他所占据的空间就会被释放</p>
<h3 id="资源-resource"><a href="#资源-resource" class="headerlink" title="资源  resource"></a>资源  resource</h3><p>一般来说，我们不能自己去创建一个资源，所有的资源都是php已经预先定义好的，我们所能做的就是直接拿过来使用。</p>
<h3 id="数据类型的转换"><a href="#数据类型的转换" class="headerlink" title="数据类型的转换"></a>数据类型的转换</h3><p>字符串存储在计算机中，是以ASCII编码进行存储，所以他们的存储方式不一样，在做不同数据类型计算的时候，计算机会自动的做一个数据类型的转换</p>
<p>计算机自动的做数据类型的转换</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">$a = 12;</div><div class="line">$b = &apos;4abc&apos;;</div><div class="line">echo $a+$b;</div></pre></td></tr></table></figure>
<p>获取的数据和我们想要的结果不一样，所以我们需要手动的做数据类型的转换</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">$a = 12;</div><div class="line">$b = 3.45;</div><div class="line">echo $a+(int)$b;</div></pre></td></tr></table></figure>
<p>(需要转换的数据类型)需要转换的数字即可</p>
<blockquote>
<p>如果是一个纯数字的字符串转换的结果就是数字本身，如果带有字母，则从最左边寻找，如果遇到字母，则直接将右边的部分抛弃，如果是空的内容，则强制转换整型的结果为0，false为0,true为1</p>
</blockquote>
<h3 id="运算符"><a href="#运算符" class="headerlink" title="运算符"></a>运算符</h3><p>当进行逻辑运算的时候，如果左边已经达到了最终的结果，那么php为了节省运算的时间，右边就不进行运算了，那么相当于右边的内容被短路了。所以为了避免逻辑短路，尽量不要在逻辑运算符中做算数运算</p>
<blockquote>
<p>思考： a++和a+=1对于a本身而言是否一样？<br>答案： 不一样，在++操作字符串的时候，他会做ASCII编码操作。<br>一般来说，只有在算数运算中使用自增自减操作</p>
</blockquote>
<h3 id="常用的函数"><a href="#常用的函数" class="headerlink" title="常用的函数"></a>常用的函数</h3><p><strong>isset()</strong></p>
<p>isset(变量名) ： 判断一个变量是否已经被定义。如果被定义，返回的结果是true，否则返回的结果是false。<br>只有变量没有被定义或者变量被定义的结果是null，那么isset()返回的结果是false，除此以外，只要你定义了这个变量，isset的结果就是true。</p>
<p><strong>empty()</strong></p>
<p>语法：empty(变量名)，如果变量里面的内容不为空，则返回的结果是false，否则返回的结果为true。</p>
<p>empty转换的结果和boolean转换的结果正好相反，所以，只需要记住其中一个就可以了。</p>
<p><strong>is_XXX</strong></p>
<p>XXX表示一个数据类型。<br>is_int(变量)  判断变量是否是一个整型，true表示是整型，false表示不是整型。<br>is_boolean()<br>is_string()<br>is_float()</p>
<h3 id="替代语法"><a href="#替代语法" class="headerlink" title="替代语法"></a>替代语法</h3><p>将开始的大括号使用:进行替代，将结束的大括号使用end XXX来替代，这里面的XXX代表的就是这个结构的名称<br>结尾加上“;”分号</p>
<blockquote>
<p>替代语法一般来说，是写在html和php的混编语言中<br>使用替代语法，可以非常清晰明了的判断，结束标记到底是属于哪个结构</p>
</blockquote>
<p><strong>if语句中如果要是用elseif的话在else和if之间不要加上空格</strong></p>
<blockquote>
<p>思考：如果for循环执行了n次循环，那么初始化变量，条件判断和变量更新分别执行了多少次？<br>答案： 初始化变量执行1次，条件判断执行n+1次，变量更新执行n次。</p>
</blockquote>
<p><strong>break,continue参数的问题</strong><br>break和continue默认的参数是1，代表break和continue只会跳出当前的一层for循环，如果你想让break和continue一次性跳出多层循环，需要在break和continue的后面加上一个需要跳出的层数</p>
<p><strong>关于switch跳出循环的问题</strong><br>我们可以将switch看成是一个只执行一次的循环体，所以如果要在switch中跳出循环，则要在break的基础上+1</p>
<p>在switch语句中写break和continue的效果是一模一样的</p>
<h3 id="绝对路径和相对路径"><a href="#绝对路径和相对路径" class="headerlink" title="绝对路径和相对路径"></a>绝对路径和相对路径</h3><p>所谓的相对路径，就是相对于当前文件去查找另一个文件就是一个相对路径。<br>绝对路径就是不参照任何一个位置，所书写的地址。<br>程序中的绝对路径就是从盘符开始，去书写一个路径</p>
<p>../文件名       上一级文件夹<br>./文件名        当前文件夹<br>文件名        当前文件夹</p>
<h3 id="包含文件"><a href="#包含文件" class="headerlink" title="包含文件"></a>包含文件</h3><p>所谓的包含文件就是将需要的文件加载到你所编写的文件中去，包含文件有四种方式。<br><code>include</code>  <code>include_once</code>  <code>require</code>   <code>require_once</code></p>
<p><strong>include加载文件</strong><br>语法，include(需要加载的文件) ， include 需要加载的文件</p>
<blockquote>
<p>相对路径的位置不太好确定，在工作中容易引发报错，所以在工作中最好去使用绝对路径</p>
</blockquote>
<p>打开phpinfo()，搜索include_path</p>
<p>使用<code>set_include_path</code>(‘需要设置的目录’)<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">$str = get_include_path();</div><div class="line">set_include_path(&apos;c:/php/joker;&apos;.$str);</div><div class="line">include(&apos;joker.php&apos;);</div></pre></td></tr></table></figure></p>
<blockquote>
<p>思考，将原来的路径放在新增文件夹路径的左边效率更高还是右边效率更高？<br>答案：放在右边更高<br>一般情况下，在项目中，会将所有需要加载的文件统一放在一个文件夹中，通过set_include_path去进行设置加载</p>
</blockquote>
<p><strong>include PK require</strong><br>require也是加载一个文件<br>include加载文件，如果出现了错误，会报一个警告性（warning）的错误，然后代码还会继续往下执行。<br>require加载文件，如果出现了错误，会报一个致命性（fatal error）的错误。然后代码就不会继续往下执行。</p>
<p><strong>include PK include_once</strong><br>include如果载入相同的文件都会分别去执行，但是include_once如果载入相同的文件，只会执行一次。</p>
<p><code>include_once</code> 的效率更低，因为include_once在加载一个文件之前，都会检查前面的代码，看看这个文件是否已经被加载过了</p>
<p><strong>exit()/die()</strong><br>exit()和die()是同一样函数，只不过起的名字不同。它的作用就是让一个程序终止执行。</p>
<p><strong>sleep()</strong><br>延时函数，让一个程序停止任意秒后继续执行</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/PHP核心编程/" rel="tag">#PHP核心编程</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/20160822-2.html" rel="next" title="PHP思想养成-打印菱形">
                <i class="fa fa-chevron-left"></i> PHP思想养成-打印菱形
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/20160824-1.html" rel="prev" title="Day4-php函数基础">
                Day4-php函数基础 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type = "text/javascript" src = "//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-57838eee5e2620d0" async = "async" ></script>
      
    </div>
  </div>


          </div>
          

  <p>热评文章</p>
  <div class="ds-top-threads" data-range="weekly" data-num-items="4"></div>


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="20160823-1.html"
           data-title="Day3-php基础语法-数据类型、运算符、分支结构、包含文件" data-url="http://blog.uiste.com/20160823-1.html">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.png"
               alt="uiste" />
          <p class="site-author-name" itemprop="name">uiste</p>
          <p class="site-description motion-element" itemprop="description">Stay Hungry，Stay Foolish</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">70</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              
                <span class="site-state-item-count">13</span>
                <span class="site-state-item-name">分类</span>
              
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">55</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/uiste" target="_blank" rel="external nofollow" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/uiste" target="_blank" rel="external nofollow" title="微博">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  微博
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/uiste" target="_blank" rel="external nofollow" title="知乎">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              友情链接
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.uiste.com" title="uiste 个人博客" target="_blank">uiste 个人博客</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://uiste.github.io" title="uiste 技术博客" target="_blank">uiste 技术博客</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#ASCII编码"><span class="nav-number">1.</span> <span class="nav-text">ASCII编码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#布尔型"><span class="nav-number">2.</span> <span class="nav-text">布尔型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#数组"><span class="nav-number">3.</span> <span class="nav-text">数组</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#对象"><span class="nav-number">4.</span> <span class="nav-text">对象</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#空型-null"><span class="nav-number">5.</span> <span class="nav-text">空型  null</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#资源-resource"><span class="nav-number">6.</span> <span class="nav-text">资源  resource</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#数据类型的转换"><span class="nav-number">7.</span> <span class="nav-text">数据类型的转换</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#运算符"><span class="nav-number">8.</span> <span class="nav-text">运算符</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#常用的函数"><span class="nav-number">9.</span> <span class="nav-text">常用的函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#替代语法"><span class="nav-number">10.</span> <span class="nav-text">替代语法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#绝对路径和相对路径"><span class="nav-number">11.</span> <span class="nav-text">绝对路径和相对路径</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#包含文件"><span class="nav-number">12.</span> <span class="nav-text">包含文件</span></a></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">uiste</span>
</div>

<div class="powered-by">
  由 <a class="theme-link" href="http://hexo.io" rel="external nofollow">Hexo</a> 趋势动力
</div>
<!--站长统计-->
<script src="https://s95.cnzz.com/z_stat.php?id=1259894121&web_id=1259894121" language="JavaScript"></script>
<!--<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next" rel="external nofollow">
    NexT.Mist
  </a>
</div> -->
&nbsp;&nbsp;&nbsp;本站总点击 <span id="busuanzi_value_site_pv"></span> 次
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;您是第 <span id="busuanzi_value_site_uv"></span> 位访客

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>

<script>
(function(){
    var bp = document.createElement('script');
    bp.src = '//push.zhanzhang.baidu.com/push.js';
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"uiste"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/vendors/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  
  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length == 0) {
       search_path = "search.xml";
    }
    var path = "/" + search_path;
    // monitor main search box;

    function proceedsearch() {
      $("body").append('<div class="popoverlay">').css('overflow', 'hidden');
      $('.popup').toggle();

    }
    // search function;
    var searchFunc = function(path, search_id, content_id) {
    'use strict';
    $.ajax({
        url: path,
        dataType: "xml",
        async: true,
        success: function( xmlResponse ) {
            // get the contents from search data
            isfetched = true;
            $('.popup').detach().appendTo('.header-inner');
            var datas = $( "entry", xmlResponse ).map(function() {
                return {
                    title: $( "title", this ).text(),
                    content: $("content",this).text(),
                    url: $( "url" , this).text()
                };
            }).get();
            var $input = document.getElementById(search_id);
            var $resultContent = document.getElementById(content_id);
            $input.addEventListener('input', function(){
                var matchcounts = 0;
                var str='<ul class=\"search-result-list\">';
                var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                $resultContent.innerHTML = "";
                if (this.value.trim().length > 1) {
                // perform local searching
                datas.forEach(function(data) {
                    var isMatch = true;
                    var content_index = [];
                    var data_title = data.title.trim().toLowerCase();
                    var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase();
                    var data_url = data.url;
                    var index_title = -1;
                    var index_content = -1;
                    var first_occur = -1;
                    // only match artiles with not empty titles and contents
                    if(data_title != '' && data_content != '') {
                        keywords.forEach(function(keyword, i) {
                            index_title = data_title.indexOf(keyword);
                            index_content = data_content.indexOf(keyword);
                            if( index_title < 0 && index_content < 0 ){
                                isMatch = false;
                            } else {
                                if (index_content < 0) {
                                    index_content = 0;
                                }
                                if (i == 0) {
                                    first_occur = index_content;
                                }
                            }
                        });
                    }
                    // show search results
                    if (isMatch) {
                        matchcounts += 1;
                        str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>";
                        var content = data.content.trim().replace(/<[^>]+>/g,"");
                        if (first_occur >= 0) {
                            // cut out 100 characters
                            var start = first_occur - 20;
                            var end = first_occur + 80;
                            if(start < 0){
                                start = 0;
                            }
                            if(start == 0){
                                end = 50;
                            }
                            if(end > content.length){
                                end = content.length;
                            }
                            var match_content = content.substring(start, end);
                            // highlight all keywords
                            keywords.forEach(function(keyword){
                                var regS = new RegExp(keyword, "gi");
                                match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>");
                            });

                            str += "<p class=\"search-result\">" + match_content +"...</p>"
                        }
                        str += "</li>";
                    }
                })};
                str += "</ul>";
                if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' }
                if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' }
                $resultContent.innerHTML = str;
            });
            proceedsearch();
        }
    });}

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched == false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };

    });

    $('.popup-btn-close').click(function(e){
      $('.popup').hide();
      $(".popoverlay").remove();
      $('body').css('overflow', '');
    });
    $('.popup').click(function(e){
      e.stopPropagation();
    });
  </script>


  

  

  

</body>
</html>
